/**   
 * @Title: UserBalanceContoler.java 
 * @Package com.leesche.zcsp.node.web.controller.wechat.cash.balance 
 * @Description:() 
 * @author dennies yang
 * @date 2016年10月20日 下午3:05:13 
 * @version V1.0   
 */
package com.leesche.zcsp.node.web.controller.wechat.income.balance;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.leesche.zcsp.node.web.service.SysUserBalanceService;
import com.leesche.zcsp.node.web.service.impl.data.read.QuerySysUserBalanceCondition;
import com.leesche.zcsp.node.web.service.privilege.PrivilegeService;

/**
 * @Title: UserBalanceContoler.java
 * @Package com.leesche.zcsp.node.web.controller.wechat.cash.balance
 * @Description:()
 * @author dennies yang
 * @date 2016年10月20日 下午3:05:13
 * @version V1.0
 */
@Controller
@RequestMapping(value = "/wechat/income/balance")
public class UserBalanceController {
	private static final Logger logger = Logger
			.getLogger(UserBalanceController.class);
	@Autowired
	PrivilegeService privilegeService;

	@Autowired
	SysUserBalanceService sysUserBalanceService;
	
	private final static String SHOWVIEW = "wechat/income/balance/mainView";
	

	/**
	 * 
	 * @Title: listView @Description: TODO(打开用户对账单界面) @param @param model @param @return @return
	 *         String @throws
	 */
	@RequestMapping(value = "showView", method = RequestMethod.GET)
	public String showView(Model model) {
		QuerySysUserBalanceCondition querySysUserBalanceCondition = new QuerySysUserBalanceCondition();
		querySysUserBalanceCondition.setUserId(privilegeService
				.getCurrentPrincipal().getUserid());
		model.addAttribute("balances", sysUserBalanceService
				.findByCondition(querySysUserBalanceCondition));
		return SHOWVIEW;
	}

}
